/**
 * 
 */
package com.roc.util.constant;

import org.apache.commons.lang3.StringUtils;

/**
 * @author dxpeng 2013-8-8 下午6:32:41
 */
public enum AgentType {
	 
	OEM("00","O单牌品商"),
    CHINA("01",	"全国总代"),	
	PROVINCE("02","省级分枝机构"),	
	CITY("03","市级代理"),
    AREA("04",	"区县代理"),	
	OTHERS("02","战略合作伙伴");
	
	 
	
	 
	private String code;
	private String name;
	
	private AgentType( String code,String name) {
		this.code = code;
		this.name = name;
		
	}

	

	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	public static AgentType valueOfCode(String code) {
		if (StringUtils.isBlank(code)) {
			throw new IllegalArgumentException("SysLogType code " + code
					+ " is blank");
		}
		for (AgentType ms : values()) {
			if (ms.getCode().equals(code)) {
				return ms;
			}
		}
		throw new IllegalArgumentException("SysLogType code " + code
				+ " is not exist");
	}

	
}
